package com.oocl.euc.core.maintenance.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@IdClass(SubCategoryID.class)
@Entity
@Table(name = "PCRS_SUBCATEGORY")
public class SubCategory implements Serializable {
    private static final long serialVersionUID = 1L;
    private String categoryID;

    private String subCategoryID;

    private String subcategoryName;

    private String sortSeq;

    private String circulationTo;

    private Integer active;

    private Category category;

    private boolean allowAdminTask;

    private boolean notAllowAutoApproval;

    //Send to EASC
    private String distribution;

    //default CC LIst
    private String firRequirement;

    //3rd data
    private boolean service;

    private boolean locations;

    private boolean zones;

    //Risk Assessment
    private boolean riskLevel;

    private String updatedBy;

    private Date updatedAt;

    private Date createAt;

    @Id
    @Column(name = "CATEGORY_ID", length = 20)
    public String getCategoryID() {
        return categoryID;
    }

    public void setCategoryID(String categoryID) {
        this.categoryID = categoryID;
    }

    @Id
    @Column(name = "SUBCATEGORY_ID", length = 20)
    public String getSubCategoryID() {
        return subCategoryID;
    }

    public void setSubCategoryID(String subCategoryID) {
        this.subCategoryID = subCategoryID;
    }

    @Column(name = "SUBCATEGORY_NAME", length = 200)
    public String getSubcategoryName() {
        return subcategoryName;
    }

    public void setSubcategoryName(String subcategoryName) {
        this.subcategoryName = subcategoryName;
    }

    @Column(name = "SORT_SEQ", length = 18)
    public String getSortSeq() {
        return sortSeq;
    }

    public void setSortSeq(String sortSeq) {
        this.sortSeq = sortSeq;
    }

    @Column(name = "CIRCULATION_TO", length = 300)
    public String getCirculationTo() {
        return circulationTo;
    }

    public void setCirculationTo(String circulationTo) {
        this.circulationTo = circulationTo;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    @Column(name = "ACTIVE")
    public Integer getActive() {
        return active;
    }

    public void setActive(Integer active) {
        this.active = active;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "CATEGORY_ID", referencedColumnName = "CATEGORY_ID", insertable = false, updatable = false)
    @JsonIgnore
    public Category getCategory() {
        return category;
    }

    @Column(name = "ALLOW_ADMIN_TASK")
    public boolean isAllowAdminTask() {
        return allowAdminTask;
    }

    public void setAllowAdminTask(boolean allowAdminTask) {
        this.allowAdminTask = allowAdminTask;
    }

    @Column(name = "NOT_ALLOW_AUTO_APPROVAL")
    public boolean isNotAllowAutoApproval() {
        return notAllowAutoApproval;
    }

    public void setNotAllowAutoApproval(boolean notAllowAutoApproval) {
        this.notAllowAutoApproval = notAllowAutoApproval;
    }

    @Column(name = "DISTRIBUTION")
    public String getDistribution() {
        return distribution;
    }

    public void setDistribution(String distribution) {
        this.distribution = distribution;
    }

    @Column(name = "FIR_REQUIREMENT")
    public String getFirRequirement() {
        return firRequirement;
    }

    public void setFirRequirement(String firRequirement) {
        this.firRequirement = firRequirement;
    }

    @Column(name = "SERVICE")
    public boolean isService() {
        return service;
    }

    public void setService(boolean service) {
        this.service = service;
    }

    @Column(name = "LOCATIONS")
    public boolean isLocations() {
        return locations;
    }

    public void setLocations(boolean locations) {
        this.locations = locations;
    }

    @Column(name = "ZONES")
    public boolean isZones() {
        return zones;
    }

    public void setZones(boolean zones) {
        this.zones = zones;
    }

    @Column(name = "RISK_LEVEL")
    public boolean isRiskLevel() {
        return riskLevel;
    }

    public void setRiskLevel(boolean riskLevel) {
        this.riskLevel = riskLevel;
    }

    @Column(name = "UPDATED_BY")
    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    @Column(name = "UPDATED_AT")
    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Column(name = "CREATED_AT")
    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }
}
